import Vue from 'vue';
import axios from './router/axios';
import VueAxios from 'vue-axios';
import App from './App';
import router from './router/router';
import './permission'; // 权限
import './error'; // 日志
import store from './store';
import {loadStyle} from './util/util'
import * as urls from '@/config/env';
import Element from 'element-ui';
import {
  iconfontUrl,
  iconfontVersion
} from '@/config/env';
import i18n from './lang' // Internationalization
import './styles/common.scss';
import VueClipboard from 'vue-clipboard2';
import basicContainerOneToday from './components/basic-container-one-today/main'
import basicContainerOne from './components/basic-container-one/main'
import basicContainer from './components/basic-container/main'
import thirdRegister from './components/third-register/main'
import moment from 'moment'; //导入模块
moment.locale('zh-cn'); //设置语言 或 moment.lang('zh-cn');
Vue.prototype.$moment = moment;//赋值使用

Vue.filter('formatDate', function(value, fm) {
  return moment(value).format(fm)
})
import vuescroll from "vuescroll";//引入vuescroll
import "vuescroll/dist/vuescroll.css";//引入vuescroll样式
Vue.use(vuescroll);//使用
Vue.use(router)
Vue.use(VueAxios, axios)
Vue.use(Element, {
  i18n: (key, value) => i18n.t(key, value)
})
Vue.use(window.AVUE, {
  size: 'small',
  tableSize: 'small',
  calcHeight: -90,
  i18n: (key, value) => i18n.t(key, value)
})
//注册全局容器
Vue.component('basicContainerOneToday', basicContainerOneToday)
Vue.component('basicContainerOne', basicContainerOne)
Vue.component('basicContainer', basicContainer)
Vue.component('thirdRegister', thirdRegister);
// 加载相关url地址
Object.keys(urls).forEach(key => {
  Vue.prototype[key] = urls[key];
})
Vue.use(VueClipboard);
// 动态加载阿里云字体库
iconfontVersion.forEach(ele => {
  loadStyle(iconfontUrl.replace('$key', ele));
})
// const userInfoName =  document.getElementById("userInfoName").innerhtml

Vue.config.productionTip = false;

Vue.config.devtools = true;



new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
